#include <iostream>
#include <string>
using namespace std;
class Student
{
    public:
        string name;
        int age;
        Student();
        Student(string name,int age);
        Student(const Student& other);
        const Student& operator = (const Student& rb);
        void show();
};
Student::Student()
{
    cout<<"[Empty constructor]"<<endl;
    name = "normal";
    age = 0;
}
Student::Student(string pname,int page)
{
    cout<<"[constructor with <string,int>]"<<endl;
    name = pname;
    age = page;   
}

Student::Student(const Student& other)
{
    cout<<"[copy constructor]"<<endl;
    name = other.name;
    
    age = other.age;   
}
void Student::show()
{
    cout<<"I am "<<name<<endl;
}
const Student& Student::operator = (const Student& rb)
{ 
    cout<<"[=]"<<endl;
    this->name =rb.name;
    this->age = rb.age;
    return *this;
}
void test(Student pbox)
{
    cout<<"[test] "<<endl;
}
Student createStudent()
{
    cout<<"[createStudent]"<<endl;
    Student s("created Student",20);
    return s;
}
int main()
{
    Student s1("hawk",21);
    s1.show();
    Student s2 = s1;
    s2.show();
    Student s3;   //Notice: Student box3(); define a fucntion which return type student;
    s3.show();

    s3 = s2;
    s3.show();
    // as parameter 
    test(s1);
    // as return parameter
    Student s4 = (createStudent());
    s4.show();
}